Fix java tree..(part 2)
[f432xdd.git] / java / Graph Editor / src / controllers / actions / AddEdge.java
blobd228a2370f47049070a614dcd71b0767f0576321
1 package controllers.actions;
2 import javax.swing.undo.AbstractUndoableEdit;
4 import models.GraphEdge;
5 import models.GraphVertex;
6 import controllers.*;
8 public class AddEdge extends AbstractUndoableEdit {
9 private static final long serialVersionUID = -7929100929760152271L;
10 private GraphEdge o;
11 private SelectionController selectionController;
13 public AddEdge(GraphVertex a, GraphVertex b,SelectionController selectionController)
15 o = new GraphEdge(a,b);
16 this.selectionController = selectionController;
17 redoAction();
20 private void redoAction()
22 selectionController.getModel().addEdge(o);
25 public void redo()
27 super.redo();
28 redoAction();
31 public void undo()
33 super.undo();
34 selectionController.getModel().removeEdge(o);
37 public boolean isSignificant(){
38 return true;
41 public String getPresentationName(){
42 return "Edge toevoegen.";